<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAvailableUrlsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('available_urls', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('domain')            ->default('')->comment('域名记录');
            $table->bigInteger('enterprise_id') ->default(0)->comment('所属企业');
            $table->string('miniprogram_appid') ->default('')->comment('授权方小程序appid');
            $table->string('service_appid')     ->default('')->comment('授权方服务号appid');
            $table->string('subscription_appid')->default('')->comment('授权方订阅号appid');
            $table->string('wechatpay_mchid')   ->default('')->comment('授权方微信支付商户号');
            $table->string('wechatpay_key')     ->default('')->comment('授权方微信支付秘钥');
            $table->string('login_key')         ->default('')->comment('授权方微信登录秘钥');
            $table->string('wechatpay_certificate_cert_name')->default('')->comment('授权方微信支付证书cert文件名');
            $table->string('wechatpay_certificate_key_name')->default('')->comment('授权方微信支付证书key文件名');
            $table->timestamp('expire_date')   ->nullable()       ->comment('服务到期时间');
            $table->string('remark')            ->default('')->comment('备注');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('available_urls');
    }
}
